<script type="text/javascript">
    $(function(){
        $("#wlgsmx_toolbar [name='gsId']").gsjgtree(1);
//        //计划年份
//        $("#wlgsmx_toolbar [name='year']").numberspinner({
//            min: 2000,
//            max: 2100,
//            editable: true
//        });
//        //计划月份
//        $("#wlgsmx_toolbar [name='month']").numberspinner({
//            min: 1,
//            max: 12,
//            editable: true
//        });
        //到处按钮
        $("#wlgsmx_toolbar [name='export']").click(function () {
            window.open($.webPath() + "/report/cwsfc/exportwlgs?date=" + $("#wlgsmx_toolbar [name='dateEnd']").val()
                    + "&gsId=" + $("#wlgsmx_toolbar [name='gsId']").val()
                    + "&codeId=" + $("#wlgsmx_toolbar [name='codeId']").val());
        });
        //搜索按钮
        $("#wlgsmx_toolbar [name='searchButton']").click(function () {
            $("#wlgsmx").datagrid({
                queryParams: {
                    date: $("#wlgsmx_toolbar [name='dateEnd']").val(),
                    gsId: $("#wlgsmx_toolbar [name='gsId']").val(),
                    codeId: $("#wlgsmx_toolbar [name='codeId']").val()
                }});
        });
    });
    var wlgsqueryParams = {
        date: $("#wlgsmx_toolbar [name='dateEnd']").val(),
        gsId: $("#wlgsmx_toolbar [name='gsId']").val(),
        codeId: $("#wlgsmx_toolbar [name='codeId']").val()
    };
</script>
<div style="width:100%;height:100%;">
    <div id="wlgsmx_toolbar">
        <div class="textcon">
            <table class="tb">
                <input type="hidden" name="codeId" value="${codeId!}" />
                <tr>
                    <th>公司名称：</th>
                    <td>
                        <input name="gsId" type="text" class="searchinput-text" value="${gsId!}" />
                    </td>
                    <th>截止日期：</th>
                    <td>
                        <input name="dateEnd" type="text" class="easyui-datebox searchinput-text" value="${date?string('yyyy-MM-dd')}"/>
                    </td>
                    <td style="padding-left:5px;">
                        <input name="searchButton" type="button" class="submit" plain="true"/></td>
                    <td style="padding-left:5px;font-size: 14px;font-weight:bolder">
                        <a name="export" href="#" class="easyui-linkbutton"  plain='true' data-options="iconCls:'icon-undo'">导出</a>
                    </td>
                </tr>
            </table>
        </div>
    </div>
<table id="wlgsmx" class="easyui-datagrid" data-options="
        url:'${base}/report/cwsfc/wlgsList',
        fit:true,
        pagination:true,
        singleSelect:true,
        showFooter:true,
        fitColumns:true,
        pageNumber: 1,
        toolbar:'#wlgsmx_toolbar',
        queryParams:wlgsqueryParams,
        view:groupview,
        groupField:'cgdh',
        groupFormatter:function(value,rows){
            return '采购单号:'+value+ ' - ' + rows.length + ' 条记录';
        }
">
    <thead>
    <tr>
        <th data-options="field:'gsjc',width:10,align: 'center'">公司名称</th>
        <#--<th data-options="field:'cgdh',width:19">采购单号</th>-->
        <th data-options="field:'sydwjc',width:12,align: 'center'">收益单位</th>
        <th data-options="field:'fylb',width:10,align: 'center'">费用类别</th>
        <th data-options="field:'jfsl',width:10,formatter:formatSlForHtml,align: 'right'">数量</th>
        <th data-options="field:'je',width:10,formatter:formatSlForHtml2,align: 'right'">金额</th>
        <th data-options="field:'kdse',width:7,formatter:formatSlForHtml2,align: 'right'">可抵税额</th>
        <th data-options="field:'dse',width:10,formatter:formatSlForHtml2,align: 'right'">抵税额</th>
        <th data-options="field:'jinge',width:10,formatter:formatSlForHtml2,align: 'right'">净额</th>
    </tr>
    </thead>
</table>
</div>